/**
 * Created by liguangsong on 16/8/4.
 */
import React from 'react'
import { Link, hashHistory } from 'react-router'
import getTeamColor from '../../assist/teamColor.js'

var TitleView  = React.createClass({
    render() {
        //console.log(this.props.division);
        var src = 'app/assist/teamIcon/' + (this.props.img==='hou2'?'hou':this.props.img) + '.png';
        var color = getTeamColor(this.props.name);
        return (
            <div className="teamInfoTitleView" style={{ background: color }}>
                <img onClick={this.handleClick} src="app/assist/return.png" className="return" style={{left: '25px', top: '20px'}}/>
                <p className="teamInfoTeamCity">{this.props.city}</p>
                <p className="teamInfoTeamName">{this.props.name}</p>
                <img className="teamInfoIcon" src={src} />
                <p className="teamInfoMark">{this.props.mark}</p>
                <p className="conference">#{this.props.conferenceRank} in the {this.props.conference} Conference</p>
                <p className="division">#{this.props.divisionRank} in the {this.props.division} Division</p>
            </div>
        );
    },

    handleClick(event) {
        event.preventDefault();
        hashHistory.push('/');
    }
});

export default TitleView;